Custom Event on JavaScript Class